 {% if current_user.is_authenticated %}
<form id="logoutForm" action="/logout" method="post" class="navbar-right">
    <ul class="nav navbar-nav navbar-right">
        <li>
            <span class="navbar-brand">Hello {{ current_user.username }}!</span>
        </li>
        <li>
            <a href="javascript:document.getElementById('logoutForm').submit()">注销</a>
        </li>
    </ul>
</form>
{% else %}
<ul class="nav navbar-nav navbar-right">
    <li>
        <a href="/register">注册</a>
    </li>
</ul>

{% endif %}